/**
 * Created by howiezhang on 16/12/8.
 */
(function () {
    'use strict';

    angular
        .module('app')
        .factory('APIBonusService', APIBonusService);

    APIBonusService.$inject = ['$http', '$q', '$timeout', 'CacheFactory', 'ENUM'];

    function APIBonusService($http, $q, $timeout, CacheFactory, ENUM) {

        var service = new APIEndpoint( $http, $q, $timeout, CacheFactory, 'APIBonusService' );

        service.get = function(params) {
            return this.fetch( 'ecapi.recommend.bonus.info', params, false, function(res){
                return ENUM.ERROR_CODE.OK == res.data.code ? res.data.data : null;
            });
        };

        service.list = function(params) {
            return this.fetch( 'ecapi.recommend.bonus.list', params, false, function(res){
                return ENUM.ERROR_CODE.OK == res.data.code ? res.data.data : null;
            });
        };

        return service;

    }

})();
